//
//  GHOrderHeaderView.m
//  GodHorses
//
//  Created by Mac on 2017/11/20.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "GHOrderHeaderView.h"
@interface GHOrderHeaderView()
@property(nonatomic, strong) STLabel                     *desLable;
@end
@implementation GHOrderHeaderView
+ (CGFloat)headerHeight{
    return 54;
}
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithReuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
#pragma mark --subView
- (void)configSubView{
    self.backgroundColor = [UIColor whiteColor];
    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, [GHOrderHeaderView headerHeight])];
    whiteView.backgroundColor = [UIColor whiteColor];
    [self addSubview:whiteView];
    STButton * iconButton = [[STButton alloc] initWithFrame:CGRectMake(10,  10, UIScreenWidth/2 - 20, 44)
                                                      title:@"神马国际"
                                                 titleColor:GH_firstTextColor
                                                  titleFont:16
                                               cornerRadius:0
                                            backgroundColor:nil
                                            backgroundImage:nil
                                                      image:[UIImage imageNamed:@"logo"]];
    iconButton.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
    [whiteView addSubview:iconButton];
    self.desLable = [[STLabel alloc] initWithFrame:CGRectMake(UIScreenWidth / 2, 0, UIScreenWidth/2 -20, [GHOrderHeaderView headerHeight])
                                                     text:@""
                                                textColor:GH_redColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentRight];
    [whiteView addSubview:self.desLable];
    
}
- (void)setModel:(GHOrderModel *)model{
    _model = model;
    NSString * text ;
    //订单状态 订单状态0待支付订单1待发货订单2待收货订单3待评价订单4已完成订单
    switch (model.order_status) {
        case 0:
            text = @"买家待支付";
            break;
        case 1:
            text = @"卖家带发货";
            break;
        case 2:
            text = @"卖家待收货";
            break;
        case 3:
            text = @"卖家待评价";
            break;
        case 4:
            text = @"已完成";
            break;
        case 5:
            text = @"已取消";
            break;
        default:
            break;
    }
    self.desLable.text = text;
}
@end
